<?php

require_once('../smarty_admin.php');
$sql = "select * from catalogs";
$result = mysql_query($sql);
$data_catalog = array();
while ($row = mysql_fetch_assoc($result))
{
	$data_catalog[] = $row;
	$smarty->assign('data_catalog', $data_catalog);
}


if (array_key_exists('catalog_id',$_GET)) 

{	
	$catalog_id = trim($_GET['catalog_id']);
	$smarty->assign('catalog_id', $catalog_id);
	
	
	$sql= "SELECT * FROM articles WHERE catalog_id = '".$catalog_id."'";
	
	$arr  = array();
	
	$arr = $dbobject->query($sql, MYSQL_ASSOC);
	
	
	$smarty->assign('data_article',$arr);
	
}
		
$smarty->display('article/view.tpl');
?>

